package com.yznote.cloudesk.message.mapper;

import com.yznote.cloudesk.common.pojo.Message;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;

@Component
@Mapper
public interface MessageMapper {
    Message getMessage(Long messsageId);

    List<Message> getMessageAfterTime(LocalDateTime lastTime, Long roomId);

    int insertMessage(Message message);

    List<Message> getMessagesAfterTimeByUserId(Long roomId,Long userId);

    Integer getOfflineMessageCount(Long userId,Long roomId);

    Message getLastMessage(Long roomId);

    List<Message> getRoomMessages(Long roomId);

    List<Message> getOfflineFriendMessages(Long userId,Long friendUserId);
}
